package com.lanbu.system.service.impl;
import com.lanbu.system.domain.mongo.MongoTeams;
import com.lanbu.system.mapper.MongoTeamsRepository;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class MongoTeamsService {

    private final MongoTeamsRepository teamMembersRepository;

    @Autowired
    public MongoTeamsService(MongoTeamsRepository teamMembersRepository) {
        this.teamMembersRepository = teamMembersRepository;
    }


    public List<MongoTeams> findAll() {
        return teamMembersRepository.findAll();
    }



    public Optional<MongoTeams> findById(ObjectId id) {
        return teamMembersRepository.findById(id);
    }


    public MongoTeams save(MongoTeams teamMember) {
        return teamMembersRepository.save(teamMember);
    }


    public void deleteById(ObjectId id) {
        teamMembersRepository.deleteById(id);
    }


}
